from pymongo import MongoClient
# 默认主机和端口
# client = MongoClient()
# 显示指定
def connect():
    try:
        client = MongoClient("localhost", 27017)
        print("连接成功")
        return client
    except Exception as e:
        print(f"连接失败，错误原因{e}")